package com.zxl.study.callback.v3;

/**
 * @auther zzyy
 * @create 2023-08-12 20:36
 */
public class ProgrammerV3 implements MyCallback // AImpl，实现了回调接口
{
    public void code(){
        //step1.写代码
        System.out.println("coding ProgrammerV3 实现了回调接口");

        String message = "ProgrammerV3 code.....";

        // 异步回调核心！！！ 为B.fb(IA)单独启动一个线程
        new Thread(() -> {
            new GithubV3().push(this,message);
        },"t1").start();

    }

    @Override
    public void onSuccess(String message)
    {
        System.out.println("received message:"+message.toString());
    }

    @Override
    public void onError(Exception e)
    {
        System.out.println("Exception! open： "+e.getMessage());
    }


}
